<div class='form'>
  <% form_for [@pcate,@product] do |f| %>
    <%= f.error_messages %>

    <p>
      <label for="product_name">所属类别</label>
      <%= select("product", "pcate_id", Pcate.all.collect {|p| [ p.name, p.id ] }, { :include_blank => true }) %>
    </p>

    <p>
      <label for="product_name">商品名称</label>
      <%=  f.text_field  :name,:size=>20 %>
    </p>

    <p>
      <label for="product_price">商品价格</label>
      <%=  f.text_field  :price,:size=>5 %>
    </p>


    <% for @hold in @product.holds do %>
        <p>
          <label><%=@hold.property.name%></label>
          <% if @hold.property.range_array %>
            <%=  select_tag("hold[#{@hold.property.id}][value]",
              options_for_select(@hold.property.range_array,@hold .value))%>
          <%else%>
            <%=  text_field_tag  "hold[#{@hold.property.id}][value]",@hold .value,:size=>5 %>
          <%end%>
        </p>
      <%  end %>

      <p>
        <%= f.submit button_name,:class=>'submit' %>
      </p>
    <% end %>
  </div>